import {getSeriesCourse} from '../../../api/myCourse';
Component({
  data:{
    title:"系列课程",
    courseId:0,
    selectCourseList:[],
    postData:{
    },
    seriesCourseList:[]
  },
  methods:{
    onLoad(data:any){
      let {courseId,stuId} = data
        this.setData({
          postData:{
            courseId:courseId*1,
            stuId:stuId*1
          }
        })
        this.getSeriesCourseList()
    },
    async getSeriesCourseList(){
    const postData = this.data.postData as any
   const {code,data:res} =  await getSeriesCourse(postData)
   if(code === 200){
     this.setData({
      seriesCourseList:res
     })
   }

    },
    // 订单课程详情
    courseOrder(e:any){
      const {courseserialid} = e.currentTarget.dataset
      wx.navigateTo({
        url:`/myCourse_package/pages/courseOrder/courseOrder?serialId=${courseserialid}`
      })
    }

  }
})